<script setup>
const props = defineProps({
  money: {
    type: Number
  }
})
const btnClick = () => {
  //   props.money++
  console.log(props.money)
}

// 接收 方法
const emits = defineEmits(['setMoney'])
const btnClick2 = () => {
  emits('setMoney', props.money - 1)
}
</script>

<template>
  <div class="app-page">
    我是子组件--{{ money }}

    <button @click="btnClick">查看props数据</button>
    <button @click="btnClick2">子传父修改props数据</button>
  </div>
</template>

<style scoped>
.app-page {
  width: 150px;
  height: 100px;
  border: 5px solid #000;
}
</style>
